package com.yunhe.control;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yunhe.bean.Orders;
import com.yunhe.service.AddOrders11;

/**
 * Servlet implementation class AddOrders
 */
@WebServlet("/hou/AddOrders")
public class AddOrders extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AddOrders() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		int uid = Integer.parseInt(request.getParameter("oid"));
		String os = request.getParameter("os");
		String zs = request.getParameter("zs");
		String fs = request.getParameter("fs");
		String zf = request.getParameter("zf");
		String pf = request.getParameter("pf");
		int dh = Integer.parseInt(request.getParameter("dh"));
		int sid = Integer.parseInt(request.getParameter("sid"));
		float sm = Float.parseFloat(request.getParameter("sm"));
		
		Orders or = new Orders();
		or.setUid(uid);
		or.setO_status(os);
		or.setZhifu_status(zs);
		or.setFahuo_status(fs);
		or.setZhifu_fangshi(zf);
		or.setPeisong_fangshi(pf);
		or.setDingdan_hao(dh);
		or.setSid(sid);
		or.setOmoney(sm);
		AddOrders11 addOrders11 = new AddOrders11();
		addOrders11.AddOrder(or);
		request.getRequestDispatcher("ZengJia-Order.jsp").forward(request, response);
	}

}